<template>
  <div>
    <el-table :data="tableData"
              border
              style="width: 100%"
              height="500">
      <el-table-column prop="recevier"
                       label="接收者"
                       align="center">
      </el-table-column>
      <el-table-column prop="amount"
                       label="转账金额（税后）"
                       align="center">
      </el-table-column>
      <el-table-column prop="bankNumber"
                       label="银行卡号"
                       align="center">
      </el-table-column>
      <el-table-column label="状态"
                       align="center">
        <template slot-scope="scope">
          <font v-if="scope.row.status ==1">成功</font>
          <font v-else>失败</font>
        </template>
      </el-table-column>
      <el-table-column prop="description"
                       label="说明"
                       align="center">
      </el-table-column>
      <el-table-column prop="sender"
                       label="发起人"
                       align="center">
      </el-table-column>
      <el-table-column prop="gmtCreated"
                       label="转账时间"
                       align="center">
      </el-table-column>
    </el-table>
    <el-row type="flex"
            align="middle"
            style="text-align: center">
      <el-col>
        <el-pagination @current-change="handleCurrentChange"
                       :current-page.sync="pageNum"
                       :page-size="pageSize"
                       layout="total, prev, pager, next"
                       :total="total">
        </el-pagination>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  data () {
    return {
      pageNum: 1,
      pageSize: 5,
      total: 0,
      tableData: [],
    }
  },
  mounted () {
    this.$axios.get("/financial/transfer/eftRecordsByPage?pageNum=" + this.pageNum + "&pageSize=" + this.pageSize).then(res => {
      if (res.data.code == 200) {
        this.tableData = res.data.data.data
        this.total = res.data.data.total
      }
    })
  },
  methods: {
    handleCurrentChange (val) {
      this.pageNum = val
      this.uploadTable()

    },
    uploadTable () {
      this.$axios.get("/financial/transfer/eftRecordsByPage?pageNum=" + this.pageNum + "&pageSize=" + this.pageSize).then(res => {
        if (res.data.code == 200) {
          this.tableData = res.data.data.data
          this.total = res.data.data.total
        }
      })
    }
  }
}
</script>

<style scoped>
</style>
